from PIL import ImageGrab, Image  
import os  
import time
def screenshot(name="screenshot",bbox=(0, 0, 100, 100)):
    # 获取当前文件夹路径  
    current_folder = os.getcwd()  
    # 截图整个屏幕（或者你可以指定一个bbox来截取屏幕的一部分）  
    screenshot = ImageGrab.grab(bbox)
    # 定义保存截图的文件名  
    screenshot_filename = os.path.join(current_folder, f"截图\{name}.png")  
    # 保存截图到当前文件夹  
    screenshot.save(screenshot_filename)  
    print(f"截图已保存到 {screenshot_filename}")
def screenshot_mesh_viewer(name):
    screenshot(name,(854,381,1238,822))
def screenshot_texture_viewer(name):
    screenshot(name,(651,237,1219,499))
